<template>
  <div class="hello mui-content">
    <!--<div class='title mui-text-center'>laydate日历时间插件</div>-->
    <input type="text" id="test" v-model="date" class="ipt" placeholder="" @click="myDate">
  </div>
</template>
<script>


  // import '../../static/js/layde.js'
  export default {
    name: 'hello',
    data () {
      return {
        date: null,
        //获取全局的laydate，带入到组件中
        laydate: window.laydate
      }
    },
created(){

  let now = new Date()
  this.date=now.toLocaleDateString()
},
    mounted() {

      this.laydate.render({
        elem: '#test',
        done: (value) => {
          this.date = value
        }
      })
    },
    methods:{
      myDate(){
        this.$emit("mydate",this.date);
      }
    }
  }
</script>
<style>
  .mui-content{
    background-color: white;
  }

  #test{
    border: none;
    height: 33px;
    line-height: 33px;
    font-size: 0.9rem;
    background-color: white;
  }
</style>
